home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / visulztn / lise / minilise.lha / minilise / lise.doc < prev    next >
Text File  |  1993-03-30  |  59KB  |  1,357 lines

  1.               Documentation for LISE,
  2.               -----------------------
  3.          the on Line Interactive Spectra Examination
  4.             Environment for multitasking Computers.
  5.  
  6.  
  7. A word about LISE and OTTO
  8. --------------------------
  9. Both programs were develloped from physicists in the Hyperfine group
  10. at the Hahn - Meitner - Institute in Berlin.
  11. The older Program, OTTO (after Otto Hahn), was written by Mathias Menningen.
  12. The intention of OTTO was to provide a universal program for
  13. analysing 1-dim spectra and giving pictures, ready for publication.
  14. It includes a very good multi parameter fit routine, and many
  15. specialized functions for Moessbauer, PAC and PAD.
  16. This Program has proofed very usefull when analysing data, which have been
  17. allready collected.
  18. But if you are collecting data, you want to have an On Line
  19. analysis, and you want to manage auxillary devices and spectra files
  20. simultaneusly. After a long time of incremental devellopment, OTTO
  21. has become so big, that Linking time will prevent every programm devellopment.
  22. Furthermore, the program was written in FORTRAN, and uses lots of
  23. special libraries.
  24. After all, there are implementations for the IBM PC (scaled down because
  25. of memory problems), the ATARI ST, and DEC VAXes under VMS,
  26. each having different sources and libraries. From these three Versions,
  27. only the VAX version can be considerd really, since the other computers
  28. are unable to run Multitasking.
  29. After Mathias has left the group, there was nobody, who could manage to
  30. port the OTTO to our UNIX Workstation.
  31. So the Idea came up, to create a new program, which should fulfill the
  32. following conditions:
  33. 1) It should allow for easy expansion.
  34. 2) It should work together with Hardware controlling tasks.
  35. 3) It should be able to do Analysis without any human help,
  36. 4) It should be as close as possible to the known syntax from OTTO.
  37. So I develloped LISE (after Lise Meitner).
  38. Its itention is a little bit different from OTTO, so that both programs
  39. can be considered complementary, though both of them are closely related.
  40.  
  41. OTTO is best for final analysis, giving correct error values and producing
  42.      pictures ready for publishing.
  43.  
  44. LISE is best for On Line Analysis, giving results without huge pre analysis,
  45.      (finding time 0 , finding correct background...).
  46.      gives possibility to export pictures to other programs, for further
  47.      modification and including in DTP programs.
  48.  
  49. UPDATE TO THIS:
  50. ---------------
  51. After  about 3 years of devellopment LISE has reached a level, where
  52. you can also get good Fit results and good graphical output from
  53. LISE (general multiparameter Fits were introduced on the first
  54. public release in December 1992, increased graphical resolution and
  55. the Hershey vector fonts are new to Release 2.0)
  56. So there are only some minor restrictions left (some special theory
  57. functions).  At this time a port of OTTO to UNIX seems to be
  58. completely senseless, since LISE can do this job much better.
  59. Nevertheless, for some special functions you may wish to use
  60. OTTO on the VAX.
  61.  
  62. Introduction
  63. -------------
  64. LISE is not a single program, but a collection of programs, which may
  65. be called from the system command line interface. This allows for
  66. writing macro procedures in the script language of your computer
  67. (preferably the Korn-shell on UNIX and Amiga computers, but also the
  68. Rexx language on OS/2 and the Amiga), thus having
  69. access to all system features (as for example the cron utility on
  70. UNIX and Amiga computers) and saving your time, by not teaching you
  71. another lousy macro language. The other advantage of this concept is,
  72. that you may use all routines from within your own programs via a
  73. system call.
  74. And last, but not least, this concept enables you to add and modify
  75. programs in a very easy way.
  76. To enable a beginner to write programs for LISE, the spectra format
  77. was kept so simple, but still flexible, that it is possible to use
  78. pure ASCII input and output to access spectra files (but it is recommended,
  79. that you use binary formats, because loading time is much faster and
  80. Diskspace is saved). (There is another good reason for implementing
  81. an ASCII format: It makes transport of data between different processors
  82. very simple.)
  83.  
  84.  
  85.  
  86. I. Basics
  87. -----------
  88.  
  89. spectra arrays are simply files on your disk. There are normally 3 related
  90. files, which contain the data (*.spc) the corresponding error values (*.err)
  91. and an optional nonlinear time axis (*.tim).
  92. If there is no .tim array, then the internally stored calibration factor
  93. is used. Error spectra are normally generated automatically, when the input
  94. spectra have pure statistical (sqrt(n)) errors.
  95. Spectra may be specyfied as whole spectrum by just giving the name
  96. (e.g.:
  97. ksh> ash myspectrum
  98. )
  99. If you just want to use a part of the spectrum you can use the "[" and "]"
  100. to enclose the range, where the starting channel is separated by ":"
  101. from the last channel.
  102. (e.g.:
  103. ksh> ash myspectrum[123:234]
  104. )
  105. The spectrum must allways be the first parameter !
  106. If no spectrum is specified, it is expected to be "piped" to stdin !
  107. Output goes allways to stdout (if not graphical of course) if it
  108.    is not explicitly redirected by the "-o filename" option !
  109. You can allways get help on the routine you want to use by specifying
  110.    the "-h" or "-help" option.
  111. The PAC and PAD spectra arrangement is stored in the file "global.def"
  112. The actual time calibration factor is stored in "tica.all"
  113.  
  114.  
  115. II. Files needed for LISE:
  116. ---------------------------
  117.  
  118. 1) Programms
  119.    a. graphic primitives
  120.  
  121.       pag.c                         used to erase the tektronix screen
  122.       vect.c                        routine to draw vectors from the shell
  123.       point.c                       plot a point (circle, triangle...)
  124.       tpo.c                         print text on screen. (TyPe Origin).
  125.       ash.c                         plotting spectrum with axis (Axis and SHow)
  126.       cur.c                         asking for cursor position
  127.       rmtek.c                       remove tektronix screen.
  128.       hco.c                         make a hardcopy of the tektronix screen.
  129.  
  130.    b. spectra analysis
  131.  
  132.       stype.c                       typing the contents of a spectrum
  133.       tcal.c                        makes a time calibration
  134.       fprompt.c                     finding prompt peak positions
  135.       four.c                        Fourieranalysis of spectrum
  136.       pacsplit.c                    splits an 8K spectrum into 2 1K spectra.
  137.       rvt.c                         calculates the ratio function of two spectra
  138.                        Here we use the PAD ratio function !
  139.       rvt2.c                        PAC ratio function !
  140.       nmrrvt.c                      Special asymmetrie function for Beta-NMR
  141.       linfit.c                      Polynom and linear function fit to data
  142.       expfit.c                      exponential fit, based on linear regression,
  143.                        making special fit for best background.
  144.       fit.c                         general purpose multiparameter fit
  145.       examplefn.c                   example external fit function
  146.       example.prm                   fit parameters for examplefn
  147.       fitfnback.c                   external fit function for Background (quadr.)
  148.       fitfnback.prm                 fit parameters for background
  149.       fitfn4freq.c                  external fit function for up to four
  150.                        frequencies with 1st harmonic.
  151.       fitfn4freq.prm                fit parameters for cos-fit
  152.       fitfnwkk.c                    external fit function for combined interaction.
  153.       fitfnwkk.prm                  fit parameters for combined interaction
  154.  
  155.  
  156.    c. spectra manipulation
  157.  
  158.       genspc.c                      generates an artificial spectrum.
  159.       mspc.c                        modifies an existing spectrum.
  160.                        (shifting and compressing)
  161.       ccalc.c                       floating point calculator
  162.       scalc.c                       spectra calculator (formular parser)
  163.       lbn.c                         changes the time calibration factor
  164.                       of all spectra specified.
  165.  
  166.    d. miscellaneous
  167.  
  168.       tekdaemon.c                   A programm, which reads graphic input
  169.                       from a pipe, and sends it to the actual
  170.                       tektronix emulation.
  171.                       It also may be responsable for hardcopies
  172.                       on some systems.
  173.       tekamiga.c                    The graphics communications programm
  174.                       for the amiga version of LISE.
  175.       rmtek.c                       Remove graphics daemon from system.
  176.                       You should allways use this programm before
  177.                       logging out. If you leave the system without
  178.                       removing the tekdaemon this way, you must
  179.                       remove the graphic pipe by your own before
  180.                       attempting to run the tekdaemon again.
  181.       vka.c                         read a spectrum from the halder vka and
  182.                       create corresponding error and time arrays
  183.                       Also does some other communications.
  184.       halderserv.c                  Another communication programm for the
  185.                       Halder vka.
  186.       mca.c                         Reading Spectra from the MANY 86 MCA on
  187.                       the Amiga. Includes all other communication.
  188.       MCAah.c                       Window oriented Multi Channel Analyser
  189.                       program (not only) for the MANY 86 MCA.
  190.                       It provides Life Display and some more
  191.                       complex features. (Amiga only)
  192.       auger.c                       Makes one Auger scann and reads the Spectrum.
  193.       cio.c                         CESSNA format conversion program.
  194.                       Limited to 25 Spectra and Integer !
  195.       plotio.c                      Amiga Multiplot conversion program.
  196.       jcampio.c                     JCAMP format conversion program.
  197.  
  198. 2) includefiles
  199.  
  200.       /src/lise/strigs.h            some string handling functions
  201.       /src/lise/spec.h              simple spectra i/o routines,
  202.                     readspec(), writespec(),
  203.                     and option string parsing: checkopt().
  204.       /src/lise/gfx.h               graphic primitives:
  205.                     tekopen(), vectoa(), posita(), 
  206.                     gfxtext(), gfxflush()...
  207.       /src/lise/gfxamiga.h          the same definitions for the Amiga Version
  208.                     of LISE.
  209.       /src/lise/auxcfg.h            reads the auxillary configuration file
  210.                     /dev/Aux_Config to get the device
  211.                     addresses , error handler and some
  212.                     specific information.
  213.                     filedescriptor=auxopen("entryname");
  214.  
  215. 3) shell scripts
  216.  
  217.       lise                          lise startup definitions
  218.       pas                           pag ; ash... (store parameters)
  219.       pad                           pag ; ash with last parameters
  220.       adi                           ash with last parameters
  221.       dis                           ash -d with last parameters
  222.       dpeak                         display around peaks (1-4)
  223.       dpeak2                        display around peaks (5-8)
  224.  
  225.  
  226. 4) menue files
  227.  
  228.       /usr/lib/X11/bitmaps/lise    The LISE icon in the control panel
  229.       /usr/lib/X11/helpfiles/lise  The help message for this icon
  230.       /usr/lib/X11/app-defaults/XCtrl (has been changed)
  231.       /usr/lib/X11/app-defaults/OnLine The OnLine pushbutton menu
  232.       /usr/lib/X11/app-defaults/VKA    The VKA pushbutton menu
  233.  
  234.       /src/mdl/lise.mdl             Lise Main Menu
  235.       /src/mdl/specdef.mdl          Menu for spectra definition
  236.                        (specialized global.def editor)
  237.       /src/mdl/liseprompt.mdl       Menu to find prompt peaks
  238.       /src/lise/liservt.mdl         Menu to start ratio function
  239.       /src/mdl/expfit.mdl           Menu for Exp function fit
  240.       /src/mdl/xfit.mdl             Multi parameter fit menu
  241.  
  242.  
  243. 5) other files
  244. 6) dependencies
  245.  
  246.       *.spc                      spectra files (data)
  247.       *.err                      absolute errors
  248.       *.tim                      calibrated time
  249.       *.def                      peak positions and detektor positions
  250.                    generated by fprompt.c
  251.                    Must be modified before calling pacsplit.c 
  252.       *.prm                      fit parameter files
  253.       /src/lise/Aux_Config       Text file containing description of
  254.                    auxillary devices.
  255.   !!  /src/lise/stroke.fnt       The old Vector font format is  not accepted
  256.                    in LISE 2.0. Therefore this font is
  257.                    obsolete now.
  258.       /src/lise/font/*.chr       These are the Hershey fonts for LISE
  259.                    in the famous Borland (TURBO compilers)
  260.                    compatible format (LSB/MSB).
  261.       tica.all                   Time calibration factor
  262.                    as generated by tcal
  263.       global.def                 peak positions and detektor positions
  264.                    as generated by fprompt. This file
  265.                    will be read by pacsplit.c if no
  266.                    *.def file exists
  267.       /tmp/gcursor               is generated by the tekdaemon
  268.                    to tell gfx.h where the cursor is.
  269.       /tmp/ashbdry               is generated by ash.c to store the
  270.                    actual boundaries for cur.c
  271.       /tmp/tek.pipe*             graphical communication channel  
  272.  
  273. III. Implementation notes.
  274. --------------------------
  275.  
  276. 0. Update info 2.0
  277. ------------------
  278.       The following features are new to LISE 2.0 (your benefits):
  279.    1. Increased graphical resolution conforming to the enhanced
  280.       Tektronix vectorgraphic standard (4096 X 4096)
  281.    2. The Hershey vector fonts
  282.    3. Enhanced configuration options in Aux_Config
  283.    5. Portable Binary float format
  284.    6. Some new options to the ASH command
  285.    7. Some metacharacters to select sub/super- script and greek characters.
  286.  
  287.       Implications from 1. , 2. and 3. are (your work):
  288.    1. Scripts using Font size and Tektronix coordinates
  289.       will have to be rewritten.
  290.       Coordinates have to be multiplied by 4
  291.    2. Any modifications to the old stroke font are obsolete.
  292.       The old stroke font can not be used with LISE 2.0
  293.    3. You have to change the configuration in Aux_Config again.
  294.       Look at  special chapter in this document.
  295.  
  296. 1. General:
  297. -----------
  298.    1. System requirements:
  299.       You'll need a UNIX Workstation with X11 running or at
  300.       least one additional Tektronix terminal for graphic
  301.       output. 
  302.       The Amiga Version may need a 68881/2 FPU (I have not
  303.       tested it without coprocessor, but it was compiled with the
  304.       IEEE option, so that it may not run without FPU !)
  305.       You'll need further on: >1 MB Chip RAM >2 MB Fast RAM
  306.       Any Harddisk with >3 MB free Diskspace
  307.       Interlace Workbench (with any Deinterlace card)
  308.    2. Buffer adjustment
  309.       There is one environment variable in order to change
  310.       the spectra length used by all LISE progs:
  311.       MAXSPCLEN      contains the maximum number of channels 
  312.              of your spectra
  313.       (The variable TEKBUFSIZ is obsolete in LISE 2.0, since     
  314.       its function is now well done by Aux_Config)
  315.       If this variable is not set, default values (16k data) are taken.
  316.       Type "ash -h" to get information on the default spectra length
  317.       and "tekdaemon -h" to get information on the vector buffer.
  318.       If you have a small system (Amiga 500) you should adjust this
  319.       Variable. (In the Amiga Version you may need to set BOTH
  320.       types of environment variables, the "new" env:MAXSPCLEN
  321.       and the "old" MANX and ARP style variables ! The Amiga
  322.       Version will have the command LISESET to do this)
  323.       You may also whish to adjust the Vector buffer for the
  324.       Graphic display. This can be done in the Aux_Config file.
  325.       If you have a small system it may help to specify a file name
  326.       instead of a buffer size. Then this file will be taken for
  327.       buffering (terribly slow)
  328.  
  329. 2. UNIX
  330. ---------
  331.       After copying the sources to your lise directory, try compiling the whole stuff
  332.       using make. You can also try to compile individual files using the >mklise< script.
  333.       You should add your lise directory to your default PATH environment variable and
  334.       also set the environment variable LISEPRG to the name of your lise directory.
  335.       Copy the correct >Aux_Config< file to your lise and $HOME directory. There are
  336.       different configuration files for UNIX and Amiga ! This file must be named
  337.       >Aux_Config< on your computer.
  338.       First try running the >tekdaemon< program from a tektronix grafik terminal
  339.       (xterm -T), then try some graphic primitives like >point 100 100 -crf 20.
  340.       If this fails, inspect the configuration file >Aux_Config<. You should put a copy
  341.       of this file to your $HOME directory and make any modifications on this copy, since
  342.       it will be searched first.
  343.       Check write permissions for the graphic pipes.
  344.       If the basic graphics are working you can try to plot the demospectrum using
  345.       >ash *.spc -v< (I don't know, which spectrum I put on the distribution disk, but it
  346.       has the suffix .spc) If >ash< don't print any axis numbers, check the file
  347.       >$LISEPRG/fonts/trip.chr< which contains the Vector font description.
  348.       Adjust the printer driver primitive in Aux_Config (see separate section).
  349.       Try spectra manipulation using >scalc<
  350.       If everything is properly intalled, you should not need to run the tekdaemon
  351.       explicitly (at least on X-Window machines). The Tektronix emulation should
  352.       come up automatically, if you request any graphics output. If this is not
  353.       the case, check the file >gfx.h< for the calling of >tekdaemon<. check, if the
  354.       environment variable $LISEPRG is set correctly.
  355.       You must allways use >rmtek< to remove the graphic daemon, or you will have
  356.       a graphic pipe remaining, which disables running of tekdaemon next time you
  357.       try to make graphics. In this case try to remove the pipes manually with the
  358.       command >rm /tmp/tek*<
  359.  
  360. 3. Amiga
  361. ---------
  362.       This should be more easy, since the compiled executables are distributed also.
  363.       Install the lise directory on your harddisk and assign the logical device
  364.       LISE: to this directory. After checking the graphic primitives
  365.       (point 100 100 -crf 20; ash *.spc -v) try to adjust the printer driver in
  366.       Aux_Config. If the TekAmiga window doesn't come up check the lise: device.
  367.       Compiling of individual programms can be done using the >mklise.sh< script
  368.       (cshell script)
  369.       The TekAmiga programm must be compiled using the >mktek.sh< script. You also
  370.       will need the >mdllib.o< for the menu and requester generation.
  371.       The whole set of programms can be compiled using the >mkall.sh< script.
  372.       LISE was originally develloped for manx-C. It should compile also under
  373.       SAS-C or Gnu-C. All programms under >fit< were compiled using SAS-C,
  374.       since SAS generated faster FP-math code. There is a special script to
  375.       start the SAS-C on lise progs with the name "mklclise.sh".
  376.  
  377.       NOTE I have put a "view only" version of our Multi Channel Analyser programm
  378.       MCAah on some distribution disks. This can only be used as spectra display program.
  379.       Select >load demo< from the >extras< menu to load a spectrum. Loading of
  380.       hardware drivers has been disabled. If you need such a programm, you can ask me
  381.       for license conditions. There is also a pure PD Version available from UGA,
  382.       which is fully functional on loading handlers, but is an older Version with
  383.       some small bugs and less features.
  384. Update to this:
  385.       Since the guy who should build the Amiga MCA plug in card does not
  386.       come up with this, I put the full version we use in our experiments
  387.       in this distribution. It is now possible to add your own hardware
  388.       drivers to MCAah. If you need a special version for SPA-LEED/MEED
  389.       (Hardware support for the Snapshot from Dizemann) you may ask me
  390.       separately. The sources to MCAah are not included !
  391.  
  392. IV. Customizing Aux_Config
  393. --------------------------
  394.       Before you start working with LISE you may need to configure
  395.       $LISEPRG/Aux_Config (LISE:Aux_Config).
  396.       If you don't have access to the /src directory, you have to
  397.       copy Aux_Config to your local HOME directory and make the
  398.       modifications local. A local Aux_Config will supersede the
  399.       global configuration file.
  400.       Aux_Config contains all I/O specific dependencies needed by
  401.       any LISE program.
  402.       Entries start with a colon (:) followed by an Identifier
  403.       The Entry is finished with a hash (#) in the first column.
  404.       In the public release of LISE only the Graphical I/O is
  405.       controlled by Aux_Config. It defines the Names of the
  406.       Graphical communication files, the fonts and Printerdrivers.
  407.       Each graphical LISE window has an Entry ":gfx0" .. ":gfxn"
  408.       The Line containing the communication file may contain a
  409.       "commercial at" (@) to make this file private to a local user.
  410.       This will typically be done in the first entry. Actually it
  411.       generates a pipe with the user name appended to enable
  412.       multible users at the same time to use a window 0.
  413.       You may also change the primary and secondary font as you like.
  414.       The x-size and y-size of each font may be changed separately
  415.       in the lines following the font name.
  416.       Also the size of the vector buffer for the tekdaemon is
  417.       now customizable in Aux_Config. There are some reasons for
  418.       changing the predefined values:
  419.    1. You use the "circle" mode display on large spectra or a lot of text 
  420.       and the hardcopy doesn't draw the spectrum completely.
  421.       => increase the Vectorbuffer of the Window you use.
  422.    2. Your system is low on memory (especialy Amiga systems with
  423.       "only" 4 MB fast RAM) and you have too much swapping or
  424.       crashes on the Amiga.
  425.       => decrease the Vectorbuffer and allow only the first Window
  426.       to buffer its vectors. As a consequence of this, the Tekamiga
  427.       windows do not redraw theier contents on window resize.
  428.    3. You want to have all Tekamiga windows with hardcopy option.
  429.       => give a non 0 buffersize to these windows (~256000)
  430.    4. There is also a possibility to specify a file name instead of
  431.       a buffersize. In this case the file will be used as vector buffer.
  432.       You should not expect this to be fast, but it gives you the chance
  433.       to make high quality pictures even on small machines.
  434.  
  435.       The most prominent candidate for customizing is the Printerdriver.
  436.       The last entry in each gfx definition contains the name of a
  437.       printerdriver, which will be defined later in Aux_Config.
  438.       There are mainly two different types of printerdrivers available:
  439.    1. Pixel oriented printers (Epson and HP styles are supported)
  440.    2. Vector oriented printers / plotters
  441.       There are some example entries which should guide you in
  442.       designing an entry for your printer.
  443.       Here follows a description of the example entry for the Epson style
  444.       Printer:
  445.  
  446. :EpsonX
  447.   PAR:     ; Output goes to this port. On UNIX systems this could look
  448.          like "/dev/lpraw".
  449.          You may also specify a real file (e.g. "/usr/tmp/liseprt")
  450.          and print this file later with a special command.
  451.   echo PRINTER error >/dev/syscon   ; A command to execute on
  452.          the occurence of a printer trouble. Up to now ignored
  453.   PRINTER error ; message to be printed in the event of an error
  454.          Up to now ignored.
  455.   nil:     ; file to print error message on. Up to now ignored
  456.   IGNORE   ; optional system command after printing. This option is usefull
  457.          for networking in conjuction with writing output
  458.          to a file instead of a device.
  459.          The keyword IGNORE prevents execution of a command.
  460.          Amiga batch files must be called with "execute myfile".
  461.   3        ; number of passes (only needed for Epson style printers)
  462.   1        ; key number for the printer driver:
  463.          0 = number of dot image characters msb lsb
  464.          1 = number of dot image characters lsb msb
  465.          2 = HP raster mode Portrait
  466.         3 = HP raster mode Landscape
  467.          10 = postscript mode
  468.          11 = hpgl mode
  469.   1800     ; x_size of printer   or scaling factor
  470.   800      ; y_size of printer   or scaling factor
  471.   \x1B@    ; printer initialize 
  472.          sent at the beginning
  473.   \x1BL    ; printer double density grafic
  474.          sent before each row of raster grafic
  475.   \x1B3\x01\n  ; initiate half dot line feed
  476.          sent after a normal raster row.
  477.          Must match to the number of passes.
  478.   \x1B3\x15\n  ; initiate full line feed
  479.          sent after the number of passes have been completed
  480.   \x1B@\x0C    ; send after printing
  481. #
  482.  
  483.  
  484.  
  485.  
  486. V.  Spectra file format.
  487. ------------------------
  488.  
  489. 1) simple ASCII format
  490. This format is implemented to make filetransfer between different systems
  491. more easy. It should not be used as "every day" spectra format.
  492.  
  493.    const char   = ' '
  494.  
  495.    int / float spc[max]
  496.  
  497. The simple ASCII format is identified by the first character being a blank character.
  498. Only the first number must be preceeded by a blank character.
  499.  
  500.  
  501. 2) complete ASCII spectra format
  502.  
  503.    const char   = ['1','2']                   1 for integer
  504.                                        2 for float
  505.    int    (%d)    max                         number of channels in spectrum
  506.    char   (%s)    s[80]                       spectrum comment, terminated by LF
  507.    float  (%E)    _tica                       time calibration factor
  508.    int    (%d)    _spare[4]                   for future expansion
  509.    int (%d) / float (%E)  spc[max]            data
  510.  
  511.  
  512. 3) binary spectra format:
  513.  
  514.    const byte   = 0                           Identifier for binary format
  515.    const byte   = [0,1,2]                     0 for short int (16 bits)
  516.                           1 for long int (32 bits)
  517.                           2 for float (32 bits)
  518.    short int      max                         number of channels in spectrum
  519.    char           s[80]                       spectrum comment (ASCII text)
  520.    float          _tica                       time calibration factor
  521.    short int      _spare[4]                   for future expansion
  522.    float / long / short  spc[max]             data
  523.  
  524. 4) portability:
  525.  
  526.    binary spectra formats (integer and float since LISE 2.0)
  527.    are portable across different computers (this means across
  528.    LISE programs  on different computers)
  529.    The advantage of this feature is, that you can make your
  530.    Measurements (for example) on a HP-UNIX workstation,
  531.    can controll this measurement remotely from a SUN and make
  532.    some on line analysis via NFS there. At evening you may take your
  533.    spectra on an IBM formatted Disk, go at home and make the
  534.    final analysis (with inclusion of the Data in your favourite DTP)
  535.    on your Amiga.
  536.  
  537.  
  538.  
  539. V. precedence of time calibration factors
  540. -----------------------------------------
  541.  
  542. In order to have the possibility to produce a non linear x-axis on the
  543. display, the *.tim spectra array is read with the highest priority over all
  544. other time calibration factors.
  545.  
  546. If no *.tim spectrum is present (this saves diskspace) the time calibration
  547. factor will be taken from a file with the name tica.all, in order to
  548. give you an easy way to change this calibration factor, if you, for example,
  549. find out, that your first time calibration was wrong.
  550.  
  551. If neither a *.tim file nor the tica.all file are present, the time calibration
  552. is taken from the value stored in the spectrum at generation time.
  553.  
  554.  
  555. VII. General structure
  556. -----------------------
  557.  
  558. -------------------------------
  559. |  graphic device or program  |
  560. |  (graphic Terminal at any   |
  561. |   port, xterm emulation,    |
  562. |   advanced graphic program) |
  563. -------------------------------
  564.           |
  565. -------------------------------
  566. | tekdaemon server process    |  
  567. | uses Vector Fonts and       |  
  568. | holds buffer for hardcopy.  |-------------------------------------------|
  569. | Communication via named     |                                           |
  570. | pipe (UNIX) or direct calls |                                           |
  571. | (Amiga)                     |                                           |
  572. -------------------------------                                           |
  573.           |                                                           |
  574. -------------------------------  ------------------------------           |
  575. | Unix command shell (Ksh)    |  | LISE Software pool,        |           |
  576. | or Arexx, or Any shell you  |--| User defined functions,    |-----------|
  577. | like                        |  | Hardware controll tasks    |           |
  578. -------------------------------  ------------------------------           |
  579.           |                               |                           |
  580. -------------------------------  ------------------------------           |
  581. | Graphic user interface      |  | Communication of programs  |           |
  582. | For UNIX and Amiga the      |  | via files on Disk (spectra |           |
  583. | MDL was develloped to       |  | files), unix style pipes   |           |
  584. | provide a common Interface. |  | and command line parameters|           |
  585. -------------------------------  ------------------------------           |
  586.                       ----------------------------------  |
  587.                       | Hardware description file      |  |
  588.                       | Aux_Config                     |  |
  589.                       | (global at /src/lise or local  |---
  590.                       | at $HOME)                      |
  591.                       | contains device names and error|
  592.                       | handlers and specific info.    |
  593.                       ----------------------------------
  594.  
  595.  
  596.  
  597. VIII. Vector Fonts and Text Metacharacters
  598. -------------------------------------------
  599. a. Vector Font format
  600.  
  601.    New to LISE 2.0 are the Hershey Vector fonts  
  602.    They are stored in the same format which is used by the
  603.    Borland compilers (Turbo C, Turbo Pascal), to enable
  604.    easy exchange and enhancement of fonts.
  605.    Supplied Fonts:
  606.    fonts/trip.chr : font with "serifen"
  607.    fonts/sans.chr : font without "serifen"
  608.    fonts/litt.chr : small font
  609.    fonts/goth.chr : Old English Gothic
  610.    fonts/symb.chr : mathematical symbols
  611.    fonts/scri.chr : Handwriting style
  612.  
  613. b. Meta Characters
  614.  
  615.    LISE Metacharacters are introduced with a Backslash.
  616.    Since your shell may also interprete the Backslash
  617.    as another Metacharacter you may have to write
  618.    TWO Backslashes (\\) in order to pass the Metacharacter
  619.    to any LISE program. The most prominent candidate for
  620.    such an operation will be the TPO command, which types
  621.    a text at a specified Origin.
  622.    defined Metacharacters:
  623.  
  624.    \\    is the Backslash (of course)
  625.    \u    "up" move to Superscript
  626.    \d    "down" move to Subscript
  627.    \1    select primary font
  628.    \2    select secondary font (the Mathematical Symbol font)
  629.    \b    backspace one (non proportional) character
  630.    \0    deactivate proportional mode
  631.  
  632. c. Aux_Config Entry for Tekdaemon/TekAmiga
  633.  
  634.    You may now specify fonts and printerdriver for each
  635.    LISE window separately in the Aux_Config file. The format
  636.    is for each window GFXn:
  637.  
  638.    1. Communication file
  639.    2. primary font file
  640.    3. initial x size
  641.    4. initial y size
  642.    5. secondary font file
  643.    6. initial x size
  644.    7. initial y size
  645.    8. Size of Vector Buffer in bytes
  646.    9. Printer driver for Hardcopy as defined later in Aux_Config
  647.  
  648.  
  649. IX. Description of routines:
  650. ----------------------------
  651. a. graphic primitives
  652.  
  653.       pag               clear grafic window
  654.     -------             standard spectra options:
  655.              -h  (call help routine)
  656.              -help (call help routine)
  657.              -p n (sets grafic pipe number)
  658.              -n  (n=0..6 specifies a subwindow)
  659.  
  660.  
  661.  
  662.       vect              draw a vector on the grafic screen
  663.     -------             vect x y [x2 y2] [options]
  664.             standard spectra options:
  665.              -h  (call help routine)
  666.              -help (call help routine)
  667.              -p n (sets grafic pipe number)
  668.              -n  (n=0..6 specifies a subwindow)
  669.  
  670.  
  671.  
  672.       point             plot a point on the grafic screen
  673.     --------            point x y [options]
  674.              options:
  675.               -v        draws vectors
  676.               -c        draws circles
  677.               -cir n    draws circles with radius n.m
  678.               -crf n    draws filled circles with radius n
  679.               -tri n    draws triangles with baseline n (negative n gives
  680.                                     inverted triangles)
  681.               -trf n    draws filled triangles with baseline n
  682.               -qua n    draws quadrates with baseline n
  683.               -qaf n    draws filled quadrates with baseline n
  684.             standard spectra options:
  685.              -h  (call help routine)
  686.              -help (call help routine)
  687.              -p n (sets grafic pipe number)
  688.              -n  (n=0..6 specifies a subwindow)
  689.  
  690.  
  691.  
  692.       tpo               print text on the grafic screen
  693.     -------             tpo x y [options] -t text
  694.              options:
  695.                -w n         gives angle in degree
  696.                -xs n        sets size of characters (integers)
  697.                -ys n        sets size of characters (integers)
  698.                -xt n        sets repetition (thicknes) for x
  699.                -yt n        sets repetition (thicknes) for y
  700.                -font name   sets fontname
  701.                -c n         sets paper and ink colour
  702.             standard spectra options:
  703.              -h  (call help routine)
  704.              -help (call help routine)
  705.              -p n (sets grafic pipe number)
  706.              -n  (n=0..6 specifies a subwindow)
  707.  
  708.           !!! NOTE !!! DON'T FORGET THE "-t" BEFORE YOUR TEXT STARTS !!!
  709.  
  710.  
  711.       rmtek
  712.     --------
  713.  
  714.       hco               hco [-out drivername] [-iff filename] [-hpgl filename] [-ps filename]
  715.     -------             make hardcopy of LISE picture
  716.             options:
  717.                -out  string       sets another printer driver
  718.                -iff  filename     print Amiga IFF (bitmap) output to file
  719.                -hpgl filename     print HP-GL output to file
  720.                -ps   filename     print PostScript output to file
  721.                -bold              make all lines twice as thick
  722.             standard spectra options:
  723.              -h  (call help routine)
  724.              -help (call help routine)
  725.              -p n (sets grafic pipe number)
  726.              -n  (n=0..6 specifies a subwindow)
  727.  
  728.  
  729. b. spectra analysis
  730.  
  731.       stype           use this utility to convert spectra types
  732.     --------         options:
  733.              -i  (Integer ASCII output),
  734.              -r  (float ASCII output),
  735.              -i2 (short integer binary),
  736.              -i4 (long integer binary),
  737.              -r4 (float binary, !! NOT PORTABLE !! yet),
  738.              -wsimple (write ASCII simple spectrum)
  739.              -o name (output goes to files [.spc and .err] and not to stdout)
  740.              -h  (call help routine)
  741.              -help (call help routine)
  742.              -p n (sets grafic pipe number)
  743.              -n  (n=0..6 specifies a subwindow)
  744.  
  745.  
  746.       ash             Draw a spectrum with axis
  747.     -------           possible parameters:
  748.  
  749.             ash sp[1:1024] {-y 0} {+y 1000} {-b} {-v} {-c}
  750.              sp[min:max] specifies spectrum name and range (default is stdin)
  751.              -y n.m    specifies the lower bound
  752.              +y n.m    specifies the upper bound
  753.              -x n.m    specifies starting x
  754.              +x n.m    specifies last x
  755.              -bnmr     leaves space between axis and first/last point
  756.              -lx       logarithmic x-scale
  757.              -ly       logarithmic y-scale
  758.              -d        display only (don't draw axis)
  759.              -grid     draw a grid
  760.              -zero     draw a horizontal line at y=0
  761.              -xn       don't print x-axis numbers
  762.              -yn       don't print y-axis numbers
  763.              -cn       don't print comment
  764.              -rx       reverse x numbering
  765.              -ry       reverse y numbering
  766.              -xi       x-axis numbers are integers
  767.              -yi       y-axis numbers are integers
  768.              -xf       x-axis numbers in format a.b
  769.              -yf       y-axis numbers in format a.b
  770.              -xe       x-axis numbers in format a.bEn
  771.              -ye       y-axis numbers in format a.bEn
  772.              -x% cfmt  x-axis numbers in FLOAT C format cfmt (needs additional %)
  773.              -y% cfmt  y-axis numbers in FLOAT C format cfmt (needs additional %)
  774.              -x2       only print every second x number
  775.              -pag      clear screen before drawing
  776.              -use      use old parameters
  777.              -cur      prints cursor position after drawing
  778.              -b        draws error bars \
  779.              -v        draws vectors     - default is point only
  780.              -c        draws circles    /
  781.              -cir n    draws circles with radius n.m
  782.              -crf n    draws filled circles with radius n
  783.              -tri n    draws triangles with baseline n (negative n gives
  784.                                                        inverted triangles)
  785.              -trf n    draws filled triangles with baseline n
  786.              -qua n    draws quadrates with baseline n
  787.              -qaf n    draws filled quadrates with baseline n
  788.              -mb n     defines bottom margin
  789.              -mt n     defines top margin
  790.              -mr n     defines right margin
  791.              -ml n     defines left margin
  792.  
  793.            standard spectra options:
  794.             -h  (call help routine)
  795.             -help (call help routine)
  796.             -p n (sets grafic pipe number)
  797.             -n  (n=0..6 specifies a subwindow)
  798.  
  799.  
  800.      cur
  801.     ------           options:
  802.                +tek     prints tektronix hardware coordinates (debugging)
  803.                -xy      do NOT print time (in ns) and peak height
  804.                -xc      do NOT print channel number (recalculated !)
  805.                -x       only returns channel number (usefull for script files)
  806.                -y       only returns peakheight (usefull for script files)
  807.             standard spectra options:
  808.              -h  (call help routine)
  809.              -help (call help routine)
  810.              -p n (sets grafic pipe number)
  811.              -n  (n=0..6 specifies a subwindow)
  812.  
  813.  
  814.       tcal              time calibration:
  815.     -------             tcal file [options]
  816.             prints time difference between channels
  817.              options:
  818.               -t n.m   set time difference between two peaks
  819.               -y n     set minimum height for peaks
  820.               -mean    set minimum height for peaks to arithmetic mean of spectrum
  821.               -diff    set minimum difference between peaks
  822.               -peak    print peak positions
  823.               -quiet   don't print anything (output goes to tica.all)
  824.  
  825.  
  826.  
  827.       fprompt           Take an 8K spectrum and find the maxima (peaks)
  828.     -----------         for each single spectrum. This method (simple
  829.             maximum) is rather crude, so that you should
  830.             have a look at your spectra anyway.
  831.  
  832.             options and theier meaning:
  833.                -range number
  834.                  specifies length of single spectrum.
  835.                  is ignored when specifying a spectra
  836.                  definition file, but overwrites the
  837.                  value from global.def.
  838.                -dev number
  839.                  specifies a maximum deviation of the prompt
  840.                  peak from 2**n value.
  841.                -get filename
  842.                  read spectra definition file instead of global.def
  843.                -def filename
  844.                  redirects output to file rather than
  845.                  global.def  
  846.  
  847.              Format of spectra definition file global.def:
  848.             this file consists of 4 entrys for each spectrum
  849.             and has as many lines as spectra were present.
  850.             The entrys are:
  851.  
  852.                prompt   phase    first    last
  853.                  |        |        |        |
  854.                  |        |        |        |---- last channel containing
  855.                  |        |        |              usable data
  856.                  |        |        |
  857.                  |        |        |---- first channel containing
  858.                  |        |              usable data
  859.                  |        |
  860.                  |        |---- 1 for 0 degree spectrum
  861.                  |              2 for 90 degree spectrum
  862.                  |              negative when mirrored
  863.                  |
  864.                  |---- position of prompt peak
  865.  
  866.             
  867.  
  868.  
  869.  
  870.       four              Fast fourier transformation from input spectrum
  871.     -------             The resulting spectrum is allready a power spectrum
  872.  
  873.              options and theier meaning:
  874.                -iv        inverse spectrum
  875.                -rf name   save real part to file
  876.                -if name   save imaginary part to file
  877.                -pc n      append n peaks to comment
  878.                -pp n      print n peaks to stdout
  879.                -s         suppress printing of powerspectrum to stdout
  880.  
  881.  
  882.       pacsplit          Takes one 8K spectrum, splits it into single spectra
  883.     ------------        as defined in global.def (or any file supplied)
  884.             and adds corresponding files together.
  885.             If the parity of the spectrum was defined negative,
  886.             the spectrum is reversed when adding to the others.
  887.             AFTER calulation of the sum spectra USP1 and USP2
  888.             the errorbars are calculated using
  889.             USP1.err = sqrt(USP1.spc);
  890.             USP2.err = sqrt(USP2.spc);
  891.  
  892.              options and theier meaning:
  893.                -o1 spectrum
  894.                  defines output other than USP1
  895.                -o2 spectrum
  896.                  defines output other than USP2
  897.                -def filename
  898.                  read spectra definition from file other
  899.                  than global.def
  900.  
  901.              Format of spectra definition file global.def:
  902.             this file consists of 4 entrys for each spectrum
  903.             and has as many lines as spectra were present.
  904.             The entrys are:
  905.  
  906.                prompt   phase    first    last
  907.                  |        |        |        |
  908.                  |        |        |        |---- last channel containing
  909.                  |        |        |              usable data
  910.                  |        |        |
  911.                  |        |        |---- first channel containing
  912.                  |        |              usable data
  913.                  |        |
  914.                  |        |---- 1 for 0 degree spectrum
  915.                  |              2 for 90 degree spectrum
  916.                  |              negative when mirrored
  917.                  |
  918.                  |---- position of prompt peak
  919.  
  920.  
  921.  
  922.       rvt               calculating the ratio function
  923.     -------             rvt = (a*usp1 - b*usp2) / (a*usp1 + b*usp2)
  924.             of two spectra files.
  925.             Input is read from USP1.spc and USP2.spc.
  926.             The errorbars are calculated from the Spectra:
  927.             err = sqrt(usp1 + usp2)/(usp1 + usp2)
  928.             Before the normalizing factors a and b are calculated,
  929.             the Background is subtracted.
  930.             The default method for finding an appropriate background
  931.             is, to try linearization of the exponential decay
  932.             in USP1 and USP2. For different background values
  933.             a chi**2 is calculated after linear regression with
  934.             the logarithm of the resulting spectrum.
  935.             the value with the best chi**2 fit is taken as background.
  936.  
  937.  
  938.              options and theier meaning:
  939.                -s1 spectrum
  940.                  read 0 degree spectrum other than USP1
  941.                -s2 spectrum
  942.                  read 90 degree spectrum other than USP2
  943.                -ba1 value
  944.                  set background for 0 degree spectrum.
  945.                  (if ba2 is not specified, it is set to ba1)
  946.                  No fit is made afterwards.
  947.                -ba2 value
  948.                  set background fo 90 degree spectrum.
  949.                  (if ba1 was not specified, it is set to ba2)
  950.                  No fit is made afterwards.
  951.                -last number
  952.                  sets the background to the arithmetic
  953.                  mean of the last number channels.
  954.                  Very crude method, but it saves time,
  955.                  when running on a pure (poor) 68000 Amiga
  956.                -v
  957.                  If you are going to be nervous when the
  958.                  background fit runs, you may try this option.
  959.                  It also will tell you the background values,
  960.                  so that you might verify them, or use them
  961.                  for OTTO.
  962.  
  963.       rvt2              Splitting spectrum file into single spectra, possibly reversing
  964.     -------             them, subtracting Background
  965.             Calculating PAC Ratio function:
  966.                                 1/4
  967.                 2   (product(Si(180,t) - BACKi))
  968.              R(t) = - * --------------------------------- - 1
  969.                 3   (product(Sj(90,t) - BACKj))^(1/4)
  970.  
  971.                        1     2   [ 1
  972.              Error(t) = ------ * - * [-- * sum(1/(Si(180,t)-BACKi)) +
  973.                     R(t)+1   3   [16
  974.                                           1/2
  975.                             1                            ]
  976.                          + -- * sum(1/(Sj(180,t)-BACKj)) ]
  977.                            16                            ]
  978.  
  979.             RVT2 file [-o file] [-back n] [-last n]
  980.             options:
  981.                -o  file     output spectrum instead of stdout
  982.                -back n      background for all spectra
  983.                -last n      takes arithmetic mean of last n channels as
  984.                     background. Default is, to find the background
  985.                     by fitting an exponential curve to the spectrum
  986.                -v           ves fitted background
  987.             The definition of the spectrum is read from global.def
  988.             This file should be in a format as generated by the FPROMPT
  989.             routine and is organized as follows:
  990.             Each line consists of 4 integers.
  991.             The first specifies the Time 0 position.
  992.             The second can be +1 -1 +2 or -2 and specifies, if it is
  993.                  to be mirrored (-) and if it is a 0 degree (1)
  994.                  or 90 degree (2) spectrum
  995.                  If any other number is given, the spectrum is ignored
  996.             The last two numbers are used to specify the range
  997.             of the usable data area. Up to now, these parameters
  998.             are only significant in the last line !
  999.  
  1000.  
  1001.  
  1002.       linfit            Linear or Polynomial Fit to Data.
  1003.     ---------                                   Highest possible order: 10
  1004.             LinFIT [-in file] [-o file] [-dif file] [-v] [-poly n]
  1005.              options:
  1006.                 -in filename   reads data from spectrum file
  1007.                 -o  filename   output calculated fitcurve to spectrum file
  1008.                 -dif filename  diferentiate fitcurve and write data to spectrum
  1009.                 -v             verbouse: prints out resulting coeffitients
  1010.                 -poly n        calculate polynom of order n (default is 3)
  1011.                 -cexp n.m      calculate critical exponent for Tc = n.m
  1012.                         Formula: y = a * (Tc - x) ^b
  1013.                         if Tc is set to 0, x is assumed to be (Tc - T)
  1014.                 -nexp n.m      calculate normal exponential curve for Background n.m
  1015.                         Formula: y = a * x ^b + n.m
  1016.  
  1017.             standard spectra options:
  1018.              -i  (Integer ASCII output),
  1019.              -r  (float ASCII output),
  1020.              -i2 (short integer binary),
  1021.              -i4 (long integer binary),
  1022.              -r4 (float binary, !! NOT PORTABLE !! yet),
  1023.              -o name (output goes to files [.spc and .err] and not to stdout)
  1024.              -h  (call help routine)
  1025.              -help (call help routine)
  1026.  
  1027.  
  1028.  
  1029. c. spectra manipulation
  1030.  
  1031.       genspc
  1032.     ---------           generate spectrum
  1033.             genspc sp[{i:j}] {-lin a b} {-sin a b c} {-exp a b c}
  1034.             contrary to the normal behaviour, the WHOLE spectrum (and corresponding
  1035.             error array) is stored back
  1036.  
  1037.                -t    generate timespectrum only.
  1038.                -e    generate errorspectrum only.
  1039.                -m n  maximum of n elements
  1040.  
  1041.                -sin a b c     for all n: spc(n) = a*sin(b*n+c))
  1042.                -exp a b c     for all n: spc(n) = a+b*exp(c*n)
  1043.                -lin a b       for all n: spc(n) = a+n*b
  1044.  
  1045.       mspc              modify spectrum
  1046.     -------             mspc sp{[i:j]} n1 n2 ... {-sin} {-cos} {-exp} {-ln} {-sqr} {-sqrt} {-abs}
  1047.                          {-s n} {-d n} {-p n} {-q n}
  1048.             the contents of sp is modified starting from i, ending with j.
  1049.             contrary to the normal behaviour, the WHOLE spectrum (and corresponding
  1050.             error array) is stored back
  1051.             If n1 n2 ... is specified, then sp[i:j] is set to the constant values
  1052.             with the last one repeated up to j.
  1053.             other operations:
  1054.  
  1055.                -f   use as Filter (do not write back)
  1056.  
  1057.                -c text    change comment only.
  1058.                -tica n.m  change time calibration for this file
  1059.                -t    modify timespectrum only.
  1060.                -e    modify errorspectrum only.
  1061.  
  1062.                -sin  for all n: spc(n) = sin(spc(n))
  1063.                -cos  for all n: spc(n) = cos(spc(n))
  1064.                -exp  for all n: spc(n) = exp(spc(n))
  1065.                -ln   for all n: spc(n) = log(spc(n))
  1066.                -sqr  for all n: spc(n) = spc(n)*spc(n)
  1067.                -sqrt for all n: spc(n) = sqrt(spc(n))
  1068.                -abs  for all n: spc(n) = fabs(spc(n))
  1069.                -int  for all n: spc(n) = floor(spc(n))
  1070.                -lin  for all n: spc(n) = n
  1071.                -mir  for all n: spc(n) = spc(max-n), modifies error array too
  1072.  
  1073.                -add x  for all n: spc(n) = spc(n) + x
  1074.                -sub x  for all n: spc(n) = spc(n) - x
  1075.                -mul x  for all n: spc(n) = spc(n) * x
  1076.                -div x  for all n: spc(n) = spc(n) / x
  1077.  
  1078.                -sr  x for all n: spc(n+x) = spc(n)  (shift right)
  1079.                -srt x for all n: spc(n+x) = spc(n)  (shift right, including time)
  1080.                -sl  x for all n: spc(n) = spc(n+x)  (shift left)
  1081.                -slt x for all n: spc(n) = spc(n+x)  (shift left, including time)
  1082.                -com x compress spectra, modifying error and timearrays too
  1083.                -bel x smoothly cut spectrum after x, modifies error array too
  1084.  
  1085.             instead of numbers, other spectra arrays may be specified.
  1086.             these spectra arrays are taken starting from the first element.
  1087.             ONLY ONE OPERATION CAN BE PERFORMED AT A TIME !
  1088.  
  1089.          !!! NOTE !!! It may be necessary to specify a range for operation
  1090.                       right:      mspc myspc[0:1023] -mir
  1091.                       wrong:      mspc myspc -mir
  1092.    
  1093.  
  1094.  
  1095.       ccalc             Scientiffic number calculator
  1096.     --------            Call convention:
  1097.          ccalc formula
  1098.             or
  1099.          ccalc "formula"
  1100.          The floating point calculator (by Christoph Bohlen).
  1101.          Output goes to standard output
  1102.          !!! Warning !!! DON'T use a "*" for multiplication without preceeding the
  1103.          "*" by an backslash (\*).
  1104.          Alternatively, you may enclose the whole formula in double qoutes to
  1105.          prevent the shell from expanding the "*"
  1106.  
  1107.  
  1108.  
  1109.  
  1110.       scalc             Spectra Calculator
  1111.     --------            Call convention:
  1112.          scalc [newspc =] formula(function .. number .. spectrum ..)
  1113.  
  1114.          If no output spectrum is specified, only the first element is
  1115.          printed on standard output.
  1116.          Outputspectrum can be specified with a range.
  1117.          If outputspec allready exists, only the specified part will
  1118.          be substituted by the result of the calculation.
  1119.          No calculation will be done with the error and time arrays
  1120.  
  1121.          Possible function:
  1122.          exp(expression)
  1123.          log(expression)
  1124.          log10(expression)
  1125.          sin(expression)
  1126.          cos(expression)
  1127.          tan(expression)
  1128.          asin(expression)
  1129.          acos(expression)
  1130.          atan(expression)
  1131.          sinh(expression)
  1132.          cosh(expression)
  1133.          tanh(expression)
  1134.          sqrt(expression)
  1135.          rnd()                  returns a random number between 0 and 1
  1136.          lin()                  for(n=1;n<_MAXSPCLEN;n++) spc[n] = n;
  1137.          sum(spc)               for(n=1;n<_MAXSPCLEN;n++) sum = sum + spc[n];
  1138.          pi()                   for(n=1;n<_MAXSPCLEN;n++) spc[n] = 3.1415927
  1139.  
  1140.          Operators are +,-,*,/ and ^
  1141.           -h  (call help routine)
  1142.           -help (call help routine)
  1143.  
  1144.          !!! NOTES !!! THERE MUST BE NO BLANK CHARACTER LEFT AND RIGHT FROM
  1145.                        THE "=" OPERATOR !!!
  1146.                         right:   scalc "out=in1+in2"
  1147.                         wrong:   scalc "out = in1 + in2"
  1148.                        IF THE DESTINATION SPECTRUM DOES NOT EXIST YOU MUST
  1149.                        SPECIFY A RANGE TO TELL SCALC THE SIZE OF THE RESULTING
  1150.                        SPECTRUM.
  1151.                         right:   scalc "out[0:100]=lin"
  1152.                         wrong:   scalc "out=lin"
  1153.  
  1154.  
  1155.       lbn               changing the time calibration factors of all spectra specified
  1156.     -------             Abbreviation stands for: Late is Better than Never
  1157.          Call like
  1158.          lbn 0.03456 *.err *.spc
  1159.  
  1160.  
  1161. d. miscellaneous
  1162.  
  1163.       tekdaemonhp
  1164.     ---------------
  1165.       tekamiga          this program opens a graphic window and makes the rastport public
  1166.     -----------             -p n         specifies a number for the pipe.
  1167.             -buf n       change size of ■vector buffer(used for hardcopy)
  1168.                         You may also specify a file !
  1169.             -nohco       display only, no buffer for hardcopy
  1170.             -paper n     specifies background colour
  1171.             -ink n       specifies drawing colour
  1172.             -left n      left edge
  1173.             -top n       top edge
  1174.             -xsize n     horizontal size
  1175.             -ysize n     vertical size
  1176.  
  1177.  
  1178.       vka
  1179.     ------
  1180.       halderserv
  1181.     --------------
  1182.       mca
  1183.     ------
  1184.       MCAah             Look at special Documentation for MCAah
  1185.     --------
  1186.  
  1187.       auger             This program is used to communicate with the Auger Spectrometer
  1188.     --------            via the SR510 Lock in amplifier
  1189.          auger [options]
  1190.          possible options:
  1191.             -rs         read setup (to auger.set)
  1192.             -us         use setup (restore from auger.set)
  1193.             -scan       scan one spectrum and store result to stdout
  1194.                      use option -o to redirect output to a file
  1195.             -delay n    use n ms delay between steps. Default is 100
  1196.             -step n.m   stepwith n.m V  Default is 0.010000
  1197.             -start n.m  start voltage [V]  Default is 0.000000
  1198.             -estart n.m start energy [eV]
  1199.             -stop n.m   stop voltage [V]  Default is 5.000000
  1200.             -estop n.m  end energy [eV]
  1201.             -cal n.m    calibration factor in eV/V Default is 85.051555
  1202.             -comment str   set comment
  1203.             -notim      do not append time to comment
  1204.                if there is a file >ecal.auger<, this is taken for energy calibration
  1205.                see also Aux_Config :auger
  1206.  
  1207.       anaaug            anaaug spectrumfile [-cal n.m]
  1208.     ----------          analyse auger spectrum using peakpositions and
  1209.          peak intensities
  1210.             -cal  n.m        specifies a alternate energy calibration
  1211.             -table filename  uses a custom table for elements
  1212.             -find list       give a list of elements to search for
  1213.             -nel n           sets number of elements which contribute
  1214.             -dev n.m         sets maximum deviation between energy from
  1215.                         table and energy found by peak finder.
  1216.                         default is 0.100000
  1217.  
  1218.       augcal            augcal spectrumfile [-chan n] [-cur] -energy n.m
  1219.     ----------          change energy calibration of specified file
  1220.             -chan n            specify channel
  1221.             -cur               use cursor to select the channel
  1222.             -energy n.m        set energy of peak
  1223.             -line Xx           use auger energy of element Xx as energy
  1224.             -auto Xx           perform auto calibration for element Xx
  1225.             -table filename    uses a custom table for elements
  1226.             -v                 verbose: print out calibration factor
  1227.  
  1228.       cio               CIO Spectra conversion between LISE and CESSNA (OTTO) Format
  1229.     -------             Call convention:
  1230.               cio [*.spc] [-l2o cessnafile] [-o2l cessnafile] [-swap] [-o filename]
  1231.               options and theier meaning:
  1232.                -l2o name   LISE -> OTTO  reads a number of files (*.spc) and
  1233.                         converts them into CESSNA format; writes to file 'name'
  1234.                -o2l name   OTTO -> LISE  read  CESSNA 'name', extracts the spectrum
  1235.                         supplied as first parameter and generates a LISE spectrum
  1236.                -list name list spectra in CESSNA file name
  1237.                -swap    is for integer conversion (680x0<->VAX)
  1238.                -o name  may be specified to redirect output of LISE spectra
  1239.  
  1240.           !!! NOTES !!! YOU SHOULD NEVER FORGET THE "-swap" OPTION !!!
  1241.                         conversion is limited to Integer and a maximum of 25
  1242.                         spectra !!!
  1243.  
  1244.  
  1245.       plotio            Amiga Multiplot conversion program
  1246.      --------           Call convention:
  1247.            plotio spectrum [-l2p] [-p2l]
  1248.                  converts spectra from LISE to MULTIPLOT and vice versa
  1249.            options:
  1250.               -l2p     convert from LISE to MULTIPLOT
  1251.               -p2l     convert from MULTIPLOT to LISE
  1252.  
  1253.  
  1254.       jcampio           JCAMP conversion program
  1255.      ---------          Call convention:
  1256.            jcampio spectrum [-l2j] [-j2l]
  1257.                  converts spectra from LISE to JCAMP and vice versa
  1258.            options:
  1259.               -l2j     convert from LISE to JCAMP
  1260.               -j2l     convert from JCAMP to LISE
  1261.  
  1262.           !!! NOTE !!! This routine is a "Quick Hack" at the moment !!!
  1263.  
  1264.  
  1265.  
  1266. e. general multiparameter fit
  1267.  
  1268.    The general multiparameter fit was designed to be easyly expandable.
  1269.    You can write your own fitroutines as independend c-programms, which
  1270.    will be called from disk by the fitroutine at execution time (commonly
  1271.    named fitfn*.c).
  1272.    The fit routine takes input parameters from a file and writes the
  1273.    fit results to a similar file (commonly with the name *.prm).
  1274.    Without any graphical user interface, this is not easy to handle.
  1275.    The MDL script "xfit.mdl" makes things much easyer, but you need
  1276.    OSF-Motif and an X-Window Terminal to run xfit.mdl.
  1277.    The programm "read_table" is only used from "xfit.mdl" to support
  1278.    reading of the fit parameter files
  1279.  
  1280.  
  1281.       fit               fit [Spectrum] -t ParameterTable [-f ResultTable]
  1282.     -------                           [-o Curve] [-c tica] [-e error] [-v]
  1283.             parameters:
  1284.             -o specify output spectrum name for fit curve
  1285.             -t specify file containing parameter table
  1286.             -f specify file for the resulting parameter table
  1287.             -c generate theory curve, do not fit spectrum, use tica
  1288.             -e use absolute error for theory curve
  1289.             -v verbose: print fit progress
  1290.  
  1291.                The parameterfile which must be supplied after
  1292.                the '-t' option has the following format:
  1293.  
  1294.             1  functionname              ; discussed later
  1295.             2  epsilon maxiter dchi2     ; default: 0.0003 10 1.0
  1296.             3  first                     ; first channel to be fitted
  1297.             4  last                      ; last channel to be fitted
  1298.             5  1st [+- error] (x)        ; first parameter (const back.)
  1299.             6  2nd [+- error] (x)        ; second parameter (linear back.)
  1300.             7  3rd [+- error] (x)        ; third parameter (quad. back.)
  1301.             8  4th [+- error] (x)        ; fourth parameter (?)
  1302.                .
  1303.                .
  1304.                .
  1305.  
  1306.             The optional 'x' or 'X' identifies the parameters
  1307.             which are to be fitted. All other parameters are
  1308.             treated as constants.
  1309.             Any number behind the keyword '+-' is ignored on input
  1310.             and is used as output only.
  1311.             As fit result, a similar table is printed,
  1312.             which can be used as input again.
  1313.             You may also specify an outputfile for the fitted
  1314.             curve using the '-o' option.
  1315.  
  1316.             Fit Functions:
  1317.             Fit functions are implemented as external programms
  1318.             which will receive the following parameters:
  1319.             1. address of an array (float) of x-values.
  1320.                (or shared memory ID in UNIX)
  1321.             2. address of array (float) of results.
  1322.                (or shared memory ID in UNIX)
  1323.             3. first array element
  1324.             4. last array element
  1325.             5. size of array in bytes (used for shmat() under UNIX !)
  1326.             6. 1st parameter (float)
  1327.             7. 2nd parameter (float)
  1328.                .
  1329.                .
  1330.                .
  1331.             26. last parameter (if used)
  1332.             On Amiga Computers the Address represents the
  1333.             real memory location in decimal format (4292090)
  1334.             On UNIX Computers this parameter identifies
  1335.             a shared memory ID. See 'examplefn.c'
  1336.             On Amiga Computers it is recommended to make
  1337.             the Fit function resident, since it will be
  1338.             called very often.
  1339.  
  1340.             The Fit routine was taken from Bengt Lindgren
  1341.  
  1342.       examplefn            example fit function
  1343.     -------------          f(x) = a * cos(b * x + c)
  1344.  
  1345.       fitfn4freq           fitting 4 frequencies with 1st harmonic and damping
  1346.     --------------
  1347.  
  1348.       fitfnexp             fitting exponential curve with background
  1349.     -----------            (You should use "expfit" instead !)
  1350.  
  1351.       fitfnback            fitting background with up to quadratical term
  1352.     ------------
  1353.  
  1354.       fitfnwkk             fitting combined interaction (magnetical and electrical field
  1355.     -----------            gradients) for PAC
  1356.  
  1357.